package com.iqiyi.pps.epg.core.service.stream;

import com.iqiyi.pps.epg.api.model.web.encode.TEncodeServer;
import com.iqiyi.pps.epg.api.model.web.query.TFilter;
import com.iqiyi.pps.epg.api.model.web.query.TPage;
import com.iqiyi.pps.epg.api.model.web.stream.TChannelStreamPage;
import com.iqiyi.pps.epg.core.model.stream.LiveChannelStream;

import java.util.List;
import java.util.Map;

public interface LiveChannelStreamService {
    void save(LiveChannelStream liveChannelStream);
    void delete(LiveChannelStream liveChannelStream);
    void delete(Long fatherId,String streamName);
    LiveChannelStream getById(Long id);
    LiveChannelStream get(String streamName);
    List<LiveChannelStream> getByFatherId(Long fatherId);
    LiveChannelStream get(Long fatherId, String streamName);
    LiveChannelStream getByStreamType(Long fatherId, String streamType, String nStreamName);
    LiveChannelStream getByStreamType(Long fatherId, String streamType);
    LiveChannelStream getByStreamTypeWithIsEnable(Long fatherId, String streamType, boolean isEnable);
    LiveChannelStream getByStreamTypeAndEncodeTypeWithIsEnable(Long fatherId, String streamType, int encodeType, boolean isEnable);
    List<LiveChannelStream> getStreamsByStreamType(Long fatherId, String streamType, int encodeType, boolean isEnable);
    List<LiveChannelStream> getByIsEnable(Long fatherId, boolean isEnable);
    List<LiveChannelStream> getAll();
    List<LiveChannelStream> getEnableChannelStream();
    void edit(LiveChannelStream liveChannelStream);
    long count(Long fatherId);
    List<LiveChannelStream> getByStreamIp(String streamIp);
    Map<Long, Integer> fetchChannelStream(int liveType);
    void updateOnly(LiveChannelStream liveChannelStream);

    LiveChannelStream getByDolbyStreamName(String dolbyStreamName);

    void stopStream(String streamAddress);
    void startStream(String streamAddress, TEncodeServer encodeServer);

    TChannelStreamPage getSearchList(TPage page, TFilter filter);

    void updateChannelStreamIsEnable(LiveChannelStream stream, String isEnable);
    void updateChannelStreamStreamUrls(LiveChannelStream stream, String streamUrls, boolean isDolbyStreams);

    void updateStreamUrls(LiveChannelStream stream);

    String getByIpAndName(String streamIp, String streamName);
}
